home *** CD-ROM | disk | FTP | other *** search
/ NeXT Education Software Sampler 1992 Fall / NeXT Education Software Sampler 1992 Fall.iso / Programming / Source / WAIS / next-ui / WaisDocument.h < prev    next >
Encoding:
C/C++ Source or Header  |  1992-02-03  |  2.5 KB  |  86 lines

  1. // WaisDocument.h
  2. //
  3. // Free software created 1 Feb 1992
  4. // by Paul Burchard <burchard@math.utah.edu>.
  5. // Incorporating:
  6. /* 
  7.    WIDE AREA INFORMATION SERVER SOFTWARE:
  8.    No guarantees or restrictions.  See the readme file for the full standard
  9.    disclaimer.
  10.  
  11.    This is part of the [NeXTstep] user-interface for the WAIS software.
  12.    Do with it as you please.
  13.  
  14.    Version 0.82
  15.    Wed Apr 24 1991
  16.  
  17.    jonathan@Think.COM
  18.  
  19. */
  20. //
  21. // NOTE: There are two local files associated with a WaisDocument.  The
  22. // _contents_ file is that named by the key, which can be any type of file.
  23. // This is the file written by the -retrieve method.  The _WAIS specifications_
  24. // file (a WAIS structured file) has as its name the key with ".wais" appended
  25. // (the string W_D_EXT from Wais.h).  This is the file read/written by the
  26. // -read/writeWaisFile methods. (These associated ".wais" files allow documents
  27. // to be reused in later WAIStation sessions.)  The -initKey:, -setKey:, and
  28. // +objectFor[Complete]Key: methods ignore any terminal ".wais".  The 
  29. // +checkFileName: method requires the ".wais", but that is correct since this 
  30. // method is used to determine which files the -read/writeWaisFile methods can 
  31. // be applied to.
  32. //
  33.  
  34. #import "Wais.h"
  35.  
  36. extern _WaisDecoder waisSourceIDDecoder[], waisDocumentDecoder[];
  37. extern _WaisDecoder waisFragmentDecoder[], waisDocumentIDDecoder[];
  38.  
  39. @interface WaisDocument : Wais
  40. {
  41.     id fromSource; // outlet
  42.     DocID *waisDocID;
  43.     BOOL isRetrieved;
  44. }
  45.  
  46. // Access by string keys.
  47. + objectForCompleteKey:(const char *)aKey;
  48. + folderList;
  49. + setFolderList:aList;
  50. + (const char *)defaultHomeFolder;
  51. - setKey:(const char *)aKey;
  52.  
  53. // Creating and destroying sources.
  54. - free;
  55.  
  56. // Retrieving from source.
  57. - retrieve;
  58. - (BOOL)isRetrieved;
  59. - setUnretrieved;
  60. - fromSource;
  61. - setFromSource:aSource;
  62. - (DocID *)waisDocID;
  63. - setWaisDocID:(DocID *)theDocID; // must be s_free()-able
  64. - setWaisDocIDFromAny:(any *)docAny;
  65. - setKeyFromInfo; // uses ":headline", ":type", ":filename" info fields
  66.  
  67. // Routing error messages.
  68. + (const char *)errorTitle;
  69.  
  70. // Reading/writing WAIS files.
  71. - readWaisFile;
  72. - writeWaisFile;
  73. - (short)readWaisStruct:(const char *)structName
  74.     forElement:(const char *)elementName
  75.     fromFile:(FILE *)file
  76.     withDecoder:(WaisDecoder)theDecoder;
  77. - (short)writeWaisStruct:(const char *)structName
  78.     forElement:(const char *)elementName
  79.     toFile:(FILE *)file
  80.     withDecoder:(WaisDecoder)theDecoder;
  81. + (const char *)fileStructName;
  82. + (WaisDecoder)fileStructDecoder;
  83. + (BOOL)checkFileName:(const char *)fileName;
  84.  
  85. @end
  86.